package com.yunsom.testdemo.multiple_thread.create_functions;

/**
 * @author Xbao
 * @description
 * @date 2022/5/10 10:10
 */
public class ExtendThreadTest extends Thread{

  int i = 0;

  @Override
  public void run(){
    for (; i < 100; i++) {
      System.out.println(getName() + " " + i);
    }
  }

  public static void main(String[] args){

    for (int i = 0; i < 100; i++) {
      System.out.println(Thread.currentThread().getName() + " " + i);
      if (i == 50){
        new ExtendThreadTest().start();
        new ExtendThreadTest().start();
      }
    }
    
  }

}
